MapEvents

class MapEvents

List of supported event types by the `map` and `map snapshotter` objects, and event data format specification for each event. ``` text Simplified diagram for events emitted by the map object. ┌─────────────┐ ┌─────────┐ ┌──────────────┐ │ Application │ │ Map │ │ResourceLoader│ └──────┬──────┘ └────┬────┘ └───────┬──────┘ │ │ │ ├───────setStyleURI────────▶│ │ │ ├───────────get style───────────▶│ │ │ │ │ │◀─────────style data────────────┤ │ │ │ │ ├─parse style─┐ │ │ │ │ │ │ StyleDataLoaded ◀─────────────┘ │ │◀────{"type": "style"}─────┤ │ │ ├─────────get sprite────────────▶│ │ │ │ │ │◀────────sprite data────────────┤ │ │ │ │ ├──────parse sprite───────┐ │ │ │ │ │ │ StyleDataLoaded ◀─────────────────────────┘ │ │◀───{"type": "sprite"}─────┤ │ │ ├─────get source TileJSON(s)────▶│ │ │ │ │ SourceDataLoaded │◀─────parse TileJSON data───────┤ │◀──{"type": "metadata"}────┤ │ │ │ │ │ │ │ │ StyleDataLoaded │ │ │◀───{"type": "sources"}────┤ │ │ ├──────────get tiles────────────▶│ │ │ │ │◀───────StyleLoaded────────┤ │ │ │ │ │ SourceDataLoaded │◀─────────tile data─────────────┤ │◀────{"type": "tile"}──────┤ │ │ │ │ │ │ │ │◀────RenderFrameStarted────┤ │ │ ├─────render─────┐ │ │ │ │ │ │ ◀────────────────┘ │ │◀───RenderFrameFinished────┤ │ │ ├──render, all tiles loaded──┐ │ │ │ │ │ │ ◀────────────────────────────┘ │ │◀────────MapLoaded─────────┤ │ │ │ │ │ │ │ │◀─────────MapIdle──────────┤ │ │ ┌ ─── ─┴─ ─── ┐ │ │ │ offline │ │ │ └ ─── ─┬─ ─── ┘ │ │ │ │ ├─────────setCamera────────▶│ │ │ ├───────────get tiles───────────▶│ │ │ │ │ │┌ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ │ │◀─────────MapIdle──────────┤ waiting for connectivity │ │ │ ││ Map renders cached data │ │ │ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ┘ │ │ │ │ ```

Properties

CAMERA_CHANGED
Link copied to clipboard
val CAMERA_CHANGED: String
The camera has changed.
MAP_IDLE
Link copied to clipboard
val MAP_IDLE: String
The `map` has entered the idle state.
MAP_LOADED
Link copied to clipboard
val MAP_LOADED: String
The style has been fully loaded, and the `map` has rendered all visible tiles.``` textEvent data format (Object).
MAP_LOADING_ERROR
Link copied to clipboard
val MAP_LOADING_ERROR: String
Describes an error that has occured while loading the Map.
RENDER_FRAME_FINISHED
Link copied to clipboard
val RENDER_FRAME_FINISHED: String
The `map` finished rendering a frame.The `render-mode` property tells whether the `map` has all data (`full`) required to render the visible viewport.The `needs-repaint` property provides information about ongoing transitions that trigger `map` repaint.The `placement-changed` property tells if the symbol placement has been changed in the visible viewport.``` textEvent data format (Object):.
RENDER_FRAME_STARTED
Link copied to clipboard
val RENDER_FRAME_STARTED: String
The `map` started rendering a frame.Event data format (Object).
RESOURCE_REQUEST
Link copied to clipboard
val RESOURCE_REQUEST: String
The `ResourceRequest` event allows client to observe resource requests made by a`map` or `map snapshotter` objects.``` textEvent data format (Object):.
SOURCE_ADDED
Link copied to clipboard
val SOURCE_ADDED: String
The source has been added with `addStyleSource` method.The event is emitted synchronously, therefore, it is possible to immediatelyread added source's properties.``` textEvent data format (Object):.
SOURCE_DATA_LOADED
Link copied to clipboard
val SOURCE_DATA_LOADED: String
A source data has been loaded.Event may be emitted synchronously in cases when source's metadata is available when source is added to the style.The `id` property defines the source id.The `type` property defines if source's metadata (e.g., TileJSON) or tile has been loaded.
SOURCE_REMOVED
Link copied to clipboard
val SOURCE_REMOVED: String
The source has been removed with `removeStyleSource` method.The event is emitted synchronously, thus, `getStyleSources` will bein sync when the `observer` receives the notification.``` textEvent data format (Object):.
STYLE_DATA_LOADED
Link copied to clipboard
val STYLE_DATA_LOADED: String
The requested style data has been loaded.
STYLE_IMAGE_MISSING
Link copied to clipboard
val STYLE_IMAGE_MISSING: String
A style has a missing image.
STYLE_IMAGE_REMOVE_UNUSED
Link copied to clipboard
val STYLE_IMAGE_REMOVE_UNUSED: String
An image added to the style is no longer needed and can be removed using `removeStyleImage` method.``` textEvent data format (Object):.
STYLE_LOADED
Link copied to clipboard
val STYLE_LOADED: String
The requested style has been fully loaded, including the style, specified sprite and sources' metadata.``` textEvent data format (Object).```Note: The style specified sprite would be marked as loaded even with sprite loading error (An error will be emitted via `MapLoadingError`).Sprite loading error is not fatal and we don't want it to block the map rendering, thus this event will still be emitted if style and sources are fully loaded.